<template>
    <div class="testpagediv">
        testpage

        <screenfull class="screenffull"></screenfull>

        <el-table :data="formlist">
          <el-table-column label="第一列" prop="aaa"></el-table-column>
          <el-table-column label="第二列" prop="bbb"></el-table-column>
          <el-table-column label="操作">
              <template slot-scope="scope">
                  <div>
                      <Cell
                        :render="(h) => {
                            return render(h, scope.row)
                        }"
                      >
                      </Cell>
                  </div>
              </template>
          </el-table-column>
        </el-table>

        <el-button @click="$router.push('/app_login')">
            跳到登录
        </el-button>
        <el-button @click="$router.push('/datapage')">
            跳到登录
        </el-button>

    </div>
</template>

<script>

import Cell from 'components/common/cell'
import Screenfull from 'components/common/Screenfull'

// import tunnelMsg from '../../services/tunnelMsg.js'
import { log } from 'util';

export default {


    components: {
        Cell,
        Screenfull
    },


    data(){
        return {
            formlist:[
                {aaa:1,bbb:2},
                {aaa:1,bbb:2}
            ]
        }
    },

    mounted(){
        // tunnelMsg.tunnellist({index: 1, type: "tunnel", size: 10000}).then(res => {
        //     console.log(res)
        // })
    },


    methods: {
        render(h, row) {
            return h(
                'el-popover',
                {
                    props: {
                        placement: 'bottom',
                        trigger: 'hover'
                    },
                    style: {
                        'background-color': 'red',
                        width: '100px',
                    }
                },
                [
                    h(
                        'el-button',
                        {
                            slot: 'reference',
                            style: {
                                
                            }
                        },
                        '操作'
                    ),
                    h(
                        'el-button',
                        {
                            style: {

                            },
                            on: {
                                click: (e) => {
                                    this.$message.success("success")
                                }
                            }
                        },
                        '修改'
                    ),
                    h(
                        'el-button',
                        {
                            style: {

                            },
                            on: {
                                click: (e) => {
                                    this.$confirm('确认删除该项','操作',{
                                            confirmButtonText: '确定',
                                            cancelButtonText: '取消',
                                            type: 'warning'
                                        }).then(() => {
                                            this.$message.success("success")
                                        }
                                    )
                                }
                            }
                        },
                        '删除'
                    ),
                    h(
                        'el-button',
                        {
                            style: {

                            },
                            on: {
                                click: (e) => {
                                    this.$message.success("success")
                                }
                            }
                        },
                        '上移'
                    )
                ]
            )
        },
    }
}
</script>


<style lang="scss" scoped>



.testpagediv {
    background-color: aqua;
    margin: 300px auto;
    width: 300px;
    height: 200px;
}
</style>
